<template>
    <div class="yinru">
        <el-form ref="form" :model="form" label-width="120px">
            <el-row>
                <el-col :span="24">
                    <el-form-item label="年度选择" prop="year">
                        <el-select v-model="form.year" clearable size="mini" style="width: 120px; margin-right: 10px">
                            <el-option :value="item" :label="item" v-for="(item, index) in years" v-bind:key="index"></el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <el-form-item label="引入数据" prop="name">
                        <el-button>实际用能数据</el-button>
                        <el-button>用能指标数据</el-button>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-form-item>
                <el-button type="primary" @click="onSubmit">确定</el-button>
                <el-button @click="cancel">取消</el-button>
            </el-form-item>
        </el-form>
    </div>
</template>

<script>
export default {
    name: 'yinRu',
    components: {},
    props: ['formData'],
    data() {
        return {
            years: [],
            year: '2015',
            form: {
                year: ''
            }
        }
    },
    computed: {},
    created() {
        var years = []
        for (let index = 2014; index < 2040; index++) {
            years.push(index)
        }
        this.years = years
    },
    mounted() {
        this.$nextTick(() => {
            this.initData()
        })
    },
    methods: {
        cancel() {
            this.$emit('close', '')
        },
        initData() {},

        onSubmit() {
            this.$emit('close', '')
            // let that = this
            // this.$refs["form"].validate((valid) => {
            //     if (valid) {
            //         console.log("111")
            //         that.$emit("close", "")
            //     }
            // })
        }
    }
}
</script>

<style lang="scss" scoped>
.yinru {
}
</style>
